﻿namespace WP7Contrib.View.Controls.Reader
{
    using System.Windows;
    using System.Windows.Markup;

    [ContentPropertyAttribute("Content")]
    public class ReaderItem : ReaderTextBlock
    {
        public ReaderItem()
            : base()
        {
            this.DefaultStyleKey = typeof(ReaderItem);
        }

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
        }
   
       #region AutoSnap
        public static readonly DependencyProperty AutoSnapProperty =
            DependencyProperty.Register(
                "AutoSnap",
                typeof(bool),
                typeof(ReaderItem),
                new PropertyMetadata(OnAutoSnapChanged));

        public bool AutoSnap
        {
            get { return (bool)GetValue(AutoSnapProperty); }
            set { SetValue(AutoSnapProperty, value); }
        }

        private static void OnAutoSnapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ReaderItem ctrl = (ReaderItem)d;
            ctrl.OnAutoSnapChanged((bool)e.OldValue, (bool)e.NewValue);
        }

        protected virtual void OnAutoSnapChanged(bool oldValue, object newValue)
        {
        }
        #endregion Header

      
    }
}
